package com.ld.controller;

import com.ld.exception.MyException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Liudao
 * @Date: 2022-08-17-14:51
 * @Description:异常控制器test
 */
@RestController
@RequestMapping("/test")
public class ExController {
    //自定义异常
    @RequestMapping("aa")
    public void test1(){
        throw new MyException("警告！警告！！");
    }
    //一般异常
    @RequestMapping("bb")
    public void test2(){
        throw new RuntimeException();
    }
}
